Skip to content

Conversation

@ytetsuro
Copy link

@ytetsuro ytetsuro commented Nov 13, 2025

Description

Fixed the error message showing the wrong property name.

Please see: https://docs.npmjs.com/cli/v10/configuring-npm/package-json#engines

Scenarios Tested

Sample Commands

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @ytetsuro, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a minor but important correction in a user-facing error message. The change ensures that when a runtime is not set, the error message accurately refers to the 'engines' field in package.json instead of the incorrect 'engine' field, thereby improving clarity and guidance for developers configuring Node.js runtimes.

Highlights

  • Error Message Correction: Corrected a typo in the RUNTIME_NOT_SET error message, changing 'engine' to 'engines' when advising users to set the Node.js version in package.json.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly fixes a typo in an error message, changing 'engine' to 'engines' to match the property name in package.json. The change is accurate and improves the clarity of the error message for users. I've added one suggestion to improve code consistency by using template literals for the entire string constant.

Comment on lines 15 to 18
export const RUNTIME_NOT_SET =
"`runtime` field is required but was not found in firebase.json or package.json.\n" +
"To fix this, add the following lines to the `functions` section of your firebase.json:\n" +
`"runtime": "${supported.latest("nodejs")}" or set the "engine" field in package.json\n`;
`"runtime": "${supported.latest("nodejs")}" or set the "engines" field in package.json\n`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For consistency and better readability, you could use template literals for the entire multi-line string. This avoids mixing different string quoting styles (double quotes and backticks).1

Suggested change
export const RUNTIME_NOT_SET =
"`runtime` field is required but was not found in firebase.json or package.json.\n" +
"To fix this, add the following lines to the `functions` section of your firebase.json:\n" +
`"runtime": "${supported.latest("nodejs")}" or set the "engine" field in package.json\n`;
`"runtime": "${supported.latest("nodejs")}" or set the "engines" field in package.json\n`;
export const RUNTIME_NOT_SET =
`\`runtime\` field is required but was not found in firebase.json or package.json.\n` +
`To fix this, add the following lines to the \`functions\` section of your firebase.json:\n` +
`"runtime": "${supported.latest("nodejs")}" or set the "engines" field in package.json\n`;

Style Guide References

Footnotes

  1. The Google TypeScript Style Guide recommends using template strings instead of complex string concatenation for better readability, especially for multi-line strings or strings with interpolated values.

Copy link
Author

@ytetsuro ytetsuro Nov 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gemini-code-assist
The original code isn’t written that way — how should I handle this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/gemini review

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right that the surrounding code might not consistently use template literals for all multi-line strings. My suggestion was primarily aimed at improving the readability and consistency of this specific string by using a single string literal type (template literals) throughout, which is a recommended practice in the Google TypeScript Style Guide for multi-line strings or strings with interpolated values.

While it's a stylistic improvement, it's ultimately your decision whether to apply it, especially if there's an established project convention that differs. However, adopting this pattern for new or modified multi-line strings can help gradually improve the codebase's overall consistency and maintainability.

@ytetsuro
Copy link
Author

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly fixes a typo in an error message, changing engine to engines to match the package.json specification. The refactoring to a template literal is also a good improvement. I've added one suggestion to further enhance the clarity of the error message for a better user experience.

Comment on lines +16 to +18
`\`runtime\` field is required but was not found in firebase.json or package.json.
To fix this, add the following lines to the \`functions\` section of your firebase.json:
"runtime": "${supported.latest("nodejs")}" or set the "engines" field in package.json`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While fixing the typo is a great improvement, the error message could be made even clearer. The current phrasing might be ambiguous to users about how to resolve the issue. Presenting the two available options as a numbered list would improve readability and provide a better user experience.

  `\`runtime\` field is required but was not found in firebase.json or package.json.\nTo fix this, please specify a runtime in either of the following ways:\n1. Add \`"runtime": "${supported.latest("nodejs")}"\` to the \`functions\` section of your firebase.json.\n2. Set the \`engines\` field in your package.json (e.g. \`"engines": { "node": "20" }\`).`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant